<!DOCTYPE html>
<html lang="en">
<head>
     <!-- Bootstrap core CSS -->
     <link href="http://cdn.stosz.com/bootstrap/css/bootstrap.css?v=1.2" rel="stylesheet">
     <!--external css-->
     <link href="http://cdn.stosz.com/font/font-awesome.css?v=1.14" rel="stylesheet" />
     <link rel="stylesheet" type="text/css" href="template/assets/css/zabuto_calendar.css">
     <!--link rel="stylesheet" type="text/css" href="template/assets/js/gritter/css/jquery.gritter.css" /-->
     <!--link rel="stylesheet" type="text/css" href="template/assets/lineicons/style.css"-->
    
     <!-- Custom styles for this template -->
     <link href="template/assets/css/style.css" rel="stylesheet">
     <link href="template/assets/css/style-responsive.css" rel="stylesheet">
     <link href="template/plugins/dialog/dist/ui-dialog.css"  rel="stylesheet">
    
     <script src="http://cdn.stosz.com/javascript/jquery.js"></script>
     <script type="text/javascript" src="http://cdn.stosz.com/javascript/jquery-1.8.3.min.js"></script>
     <script type="text/javascript" src="http://cdn.stosz.com/bootstrap/bootstrap.min.js"></script>
 </head>
<body>
<div class="form-group">
    <form action="product.php?act=publicProduct&self=1" method="post">
        <div class="col-sm-2">
            <div class="form-group">
                <select name="type" class="form-control">
                    <option value="erpid"> erp id</option>
                    <option value="domain"> 域名</option>
                    <option value="title">  名称</option>
                </select>
            </div>
        </div>
        <div class="col-sm-2">
            <input class="form-control " type="text" name="keyword" value="{{ filter.keyword }}">
        </div>

        <div class="col-sm-2">
            <button type="submit" class="btn btn-default"><i class="fa fa-search"></i> 搜索 </button>
        </div>

    </form>
    <table id="sample-table-1" class="table table-striped table-bordered table-hover">
        <thead>
        <tr>
            <th>域名</th>
            <th>产品ID</th>
            <th>缩略图</th>
            <th>名称</th>
            <th>erp编号</th>
            <th>操作</th>
        </tr>
        </thead>
        
        <tbody id="searchList">
        
        </tbody>
        <tbody id="AddList">
        {% for v in goodsList %}
            <tr id="list_{{v.product_id}}">
                <td class="_domain">{{v.domain}}</td>
                <td>{{v.product_id}}</td>
                <td><img src="{{ v.thumb }}" width="40" height="40"></td>
                <td class="_title">{{ v.title }}</td>
                <td class="_number">{{v.erp_number}}</td>
                <td><button class="btn btn-default insert" type="button" tid="{{v.product_id}}" img="{{ v.thumb }}">
                        选择
                    </button></td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
    <div class="text-center">
        {{ pageHtml|raw }}
    </div>
</div>
<script>
    $(function () {
        window.parent.$('#content\\:_selectGoods_ iframe').attr('scrolling','yes');
        var dia=parent.dialog.get(window),_data=dia.data;
        //插入
        $(document.body).on("click",'button.insert',function(){
            var _arr=[],_tid=$(this).attr('tid');
            _arr['_id']=_tid;
            _arr['_number']=$('#list_'+_tid).find('._number').text();
            _arr['_title'] =$('#list_'+_tid).find('._title').text();
            _arr['_domain'] =$('#list_'+_tid).find('._domain').text();
            //如果需要库存
            window.parent.setGoodsOne(_arr,_data);
         
        });
        setTimeout(function(){
            $('#cl-wrapper').css('overflow','auto').css('display','block');
            $('#pcont').css('display','block').css('margin-left','12px');
        },500);
    });

</script>
</body>

</html>

